
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script type="text/javascript">
    var str="hello world";
    var reg=/world/;

    var rst=str.match(reg);
    console.log(rst);
</script>
</body>
</html>